<%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>子资源健康度传递规则设置</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>  
	<%@ include file="../include/common.jsp"%>
	<%@ include file="../include/jbox.jsp"%>
	<%@ include file="../include/form.jsp"%>
	<style type="text/css">
		.edit_input{
			border:1px solid #d8d8d8;
			height:20px;
			padding-top:5px;
			padding-left:5px;
		}
	</style>
	<script type="text/javascript">
		function save(){
			var healtyRule ={"isTrans":"","weight":""};
			var isTrans = $("input[name='isTrans']:checked").val();
			var weight  = $('#weight').val();
			if(isTrans==1){
				if(weight.length<=0){
					getTopWin(window).getMessageBox().alert("权重系数不能为空","提示",{width:120});
					return;
				}
				healtyRule.weight = weight;
			}else{
				healtyRule.weight=$('#weight').val("");
			}
			healtyRule.isTrans=isTrans;
			var depWin = getTopWin(window).currentWin['healthyConfigWindow'];
			depWin.set(healtyRule);
			getTopWin(window).closejBox('healthyConfigWindow');
		}
		function clickTran(index){
			if(index==1){
				$('#weight').removeAttr("disabled");
			}else{
				$('#weight').attr('disabled','disabled');
				$('#weight').val("");
			}
		}

	</script>
  </head>
  
  <body style="padding:5px;" >
    <form action="" id="healtyRuleForm" name="healtyRuleForm">
    	<table class="table_eidt" style="border:0px;">
    		<tbody>
	    			<tr>
	    				<td class="td_left" >传递方式：</td>
	    				<td class="td_right">
	    					<input type="radio" name="isTrans" onclick="clickTran(this.value)" value="0" />不传递
	    					<input type="radio" name="isTrans" onclick="clickTran(this.value)" checked="checked" value="1" />传递
	    				</td>
	    			</tr>
	    			<tr>
	    				<td class="td_left" >权重系数：</td>
	    				<td class="td_right">
	    					<input type="text" name="weight" id="weight" value="" class="edit_input"  maxlength="3" onkeydown="if(event.keyCode==13)event.keyCode=9" onKeypress="if((event.keyCode<48 || event.keyCode>57 )) event.returnValue=false" />
	    					<span id="weightTip"></span>
	    				</td>
	    			</tr>
    	</table>
    	<div  class="btn-div" style="text-align:right;" >
    			<input type="submit" value="保存" onclick="save()" class="btn-4" />
    	</div>
    </form>
  </body>
</html>
